import java.util.Scanner;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-10-15
 * Time: 21:16
 */
public class Test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        String str = in.nextLine();
        int sum = 0;
        int len = str.length();
        if(len == 1){
            if(str.equals(" ")){
                System.out.println(0);
                return;
            }
            System.out.println(1);
            System.out.println(str);
        }
        int i = 0;
        while(i < len && str.charAt(i) == ' '){
            i++;
        }
        String[] strs = new String[len];
        StringBuffer str2 = new StringBuffer();
        int j = 0;
        int flag = 0;
        for(; i < len; i++){
            if(str.charAt(i) == '"'){
                sum++;
                i++;
                while(i < len && str.charAt(i) != '"'){
                    str2.append(str.charAt(i));
                    i++;
                }
                strs[j] = str2.toString();
                str2 = new StringBuffer();
                j++;
                i++;
                flag = 1;
                continue;
            }else if(str.charAt(i) == ' ' || flag == 1){
                sum++;
                strs[j] = str2.toString();
                j++;
                str2 = new StringBuffer();
                while(i < len && str.charAt(i) == ' '){
                    i++;
                }
                i--;
                flag = 0;
                continue;
            }
            str2.append(str.charAt(i));
        }
        if(str.charAt(i - 1) != ' '){
            sum++;
            strs[j] = str2.toString();
        }
        System.out.println(sum);
        for(int x = 0; x <= j; x++){
            System.out.println(strs[x]);
        }
    }
}
